<template>
  <div>
    <index v-if="currentIndex == 0"></index>
    <cus v-if="currentIndex == 1"></cus>
    <my v-if="currentIndex == 2"></my>
    <!-- <div class="pao_bg_top">
      <div>
        <img src="../../assets/index/background.png" style="width:100%;height:3rem" />
      </div>
      <div class="luzheng_top_city">
        <div>
          <img src="../../assets/index/location_white.png" style="width:0.24rem;height:0.29rem;" />
        </div>
        <div style="margin-left:0.2rem">
          <span>浙江省-杭州市</span>
        </div>
        <div style="margin-left:0.2rem">
          <img src="../../assets/index/next.png" style="width:0.14rem;height: 0.24rem;" />
        </div>
      </div>
    </div>
    <div class="banner_top">
      <div class="banner_top_content">
        <div class="banner_top_content_item">
          <div
            v-for="(item,index) in businessList"
            :key="index"
            v-if="item.isTop == 1"
            class="banner_children"
            @click="gongshang(item.name,item.price,item.remark,item.matters,item.id,item.skipType)"
          >
            <div style="padding-left:0.10rem;padding-right:0.15rem;">
              <img :src="indexImgUrl+item.icon" style="width: 0.76rem;height: 0.76rem;" />
            </div>
            <div style="padding-left:0.1rem;padding-right:0.15rem;line-height: 0.4rem;">
              <span class="font_size07">{{item.name}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="banner_small_icon_list">
      <div class="banner_small_icon">
        <div
          v-for="(item,index) in businessList"
          :key="index"
          v-if="item.isTop == 0"
          class="banner_small_icon_tt"
          @click="gongshang(item.name,item.price,item.remark,item.matters,item.id,item.skipType)"
        >
          <div style="padding-left:0.1rem;padding-right:0.15rem;">
            <img :src="indexImgUrl+item.smallIcon" style="width:0.46rem;height: 0.46rem;" />
          </div>
          <div style="padding-left:0.1rem;padding-right:0.15rem;line-height: 0.4rem;">
            <span class="font_size07">{{item.name}}</span>
          </div>
        </div>
        <div class="banner_small_icon_tt" @click="chajia()">
          <div>
            <img src="../../assets/index/chajia.png" style="width: 0.47rem;height: 0.48rem;" />
          </div>
          <div>
            <span class="font_size07">补差价</span>
          </div>
        </div>
      </div>
    </div> -->
    <div class="pao_bottom">
      <div class="pao_bottom_div">
        <div @click="selecttab(0)">
          <div class="text_center">
            <img v-if="currentIndex==0" src="../../assets/static/tabbar/index_selected.png" style="width:0.4rem;height:0.4rem" />
            <img v-else src="../../assets/static/tabbar/index_unselected.png" style="width:0.4rem;height:0.4rem" />
          </div>
          <div>
            <span :class="currentIndex==0?'font_size23':'font_size22'">跑政通</span>
          </div>
        </div>
        <div @click="selecttab(1)">
          <div class="text_center">
            <img v-if="currentIndex==1" src="../../assets/static/tabbar/cus_selected.png" style="width:0.41rem;height:0.33rem" />
            <img v-else src="../../assets/static/tabbar/cus_unselected.png" style="width:0.41rem;height:0.33rem" />
          </div>
          <div>
            <span :class="currentIndex==1?'font_size23':'font_size22'">客服问题</span>
          </div>
        </div>
        <div @click="selecttab(2)">
          <div class="text_center">
            <img v-if="currentIndex==2" src="../../assets/static/tabbar/my_selected.png" style="width:0.28rem;height:0.32rem" />
            <img v-else src="../../assets/static/tabbar/my_unselected.png" style="width:0.28rem;height:0.32rem" />
          </div>
          <div>
            <span :class="currentIndex==2?'font_size23':'font_size22'">我的跑政</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
//import { getBusinessList } from "../../api/api";
import index from '../../components/index.vue'
import cus from '../customer/customer.vue'
import my from '../my/my/my.vue'
export default {
  components:{
    index,
    cus,
    my
  },
  data() {
    return {
      businessList: "",
      indexImgUrl: "https://api.taxwen.com/pzt/",
      currentIndex:0,
      title:'首页'
    };
  },
  mounted() {
    let params = new URLSearchParams();
    params.append("source", "weixin");
    let _this = this;
    _this.$api.getBusinessList(params)
      .then(res => {
        console.log(res);
        if (res.status == 200) {
          _this.businessList = res.data;
        }
      })
      .catch(error => {});
  },
  methods: {
    selecttab(index){
      this.currentIndex = index
      if(index == 0){
        this.title = '首页'
        this.msg = '456'
        //document.get
        document.querySelector('body').setAttribute('style', 'background:#fffff; overflow-x: hidden;');
      }
      if(index == 1){
        this.title = '客服'
        document.querySelector('body').setAttribute('style', 'background:#F8F8F8; overflow-x: hidden;');
      }
      if(index == 2){
        this.title = '我的'
        document.querySelector('body').setAttribute('style', 'background:#F8F8F8; overflow-x: hidden;');
      }
    }
  }
};
</script>
<style lang="scss" scoped>
//$titleColor:#1777FF;
.pao_bottom {
  position: fixed;
  width: 100%;
  bottom: 0;
}
.pao_bottom_div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 0.2rem;
  border-top: 0.01rem solid;
  background-color: #ffffff;
  z-index: 1000;
}
// body{
//   background: $fontcolor;
// }
</style>
